//
//  WMEArticleModel.m
//  everyDay_duiTang
//
//  Created by 恩叔 on 16/3/4.
//  Copyright © 2016年 enshu. All rights reserved.
//

#import "WMEArticleModel.h"

@implementation WMEArticleModel
- (void)dealloc
{
    [_authorId release];/**<作者Id*/
    [_authorName release];/**<专栏名称*/
    [_authorAvatar release];/**<专栏图片*/
    [_authorImage release];/**<不知*/
    [_authorIntroduction release];/**<专栏介绍*/
    [_authorContactId release];/**<联系方式*/
    [_authorServiceParam release];/**<不知道*/
    [_authorContactType release];/**<联系类型 1.微信*/
    [_authorGender release];/**<作者性别 1.女 0.男*/
    [_authorContract release];/**<作家合同*/
    [_authorServiceType release];/**<不懂 nill*/
    
    [_featuredAuthorPriority release];/*<精选 优先 数越大越靠前*/
    
    [_categoryId release];/**<类别ID*/
    [_categoryName release];/**<类别名*/
    [_categoryIcon release];/**<类别图标*/
    [_categoryEnglishName release];/**<类别英文名*/
    [_categoryImage release];/**<不知道*/
    [_categoryPriority release];/**<类别优先权*/
    
    [_categoryGroupId release];/**<类别所在的分组Id*/
    [_categoryGroupName release];/**<类别所在的分组名*/
    [_categoryGroupEnglishName release];/**<类别所在的分组英文名*/
    [_categoryGroupIcon release];/**<类别所在的分组图标*/
    [_categoryGroupLargeIcon release];/**<类别所在的分组大图标*/
    [_categoryGroupColor release];/**<类别所在的分组的颜色*/
    [_categoryGroupImage release];/**<类别所在的分组的图片*/
    
    [_articleCategoryId release];/**<类别ID*/
    [_articleCategoryName release];/**<类别名*/
    [_articleCategoryIcon release];/**<类别图标*/
    [_articleCategoryEnglishName release];/**<类别英文名*/
    [_articleCategoryImage release];/**<不知道*/
    [_articleCategoryPriority release];/**<类别优先权*/
    [_articleCategoryGroupId release];/**<类别所在的分组Id*/
    [_articleCategoryGroupName release];/**<类别所在的分组名*/
    [_articleCategoryGroupEnglishName release];/**<类别所在的分组英文名*/
    [_articleCategoryGroupIcon release];/**<类别所在的分组图标*/
    [_articleCategoryGroupLargeIcon release];/**<类别所在的分组大图标*/
    [_articleCategoryGroupColor release];/**<类别所在的分组的颜色*/
    [_articleCategoryGroupImage release];/**<类别所在的分组的图片*/
    
    
    [_articleImageUrl release];/**<文章的图片链接*/
    [_articleImageType release];/**<文章的图片类型*/
    
    [_articleId release];/**<文章的ID*/
    [_articleTitle release];/**<文章的标题*/
    [_articleSummary release];/**<文章的摘要*/
    [_articleThumbnail release];/**<文章的缩略图*/
    [_articleUrl release];/**<文章的请求链接*/
    [_articleWeblink release];/**<文章的网页链接*/
    [_articlePublishTime release];/**<文章的发布时间*/
    [_articleCreatedTime release];/**<文章的创建时间*/
    [_articleModifiedTime release];/**<文章的修改时间*/
    [_articleStatsRead release];/**<文章的阅读数*/
    [_articleStatsLike release];/**<文章的喜欢数*/
    [_articleStatsDislike release];/**<文章的厌恶数*/
    [_articleStatsComment release];/**<文章的评论*/
    [_articleStatsFavorite release];/**<文章的...*/
    [_articleStatsShare release];/**<文章的分享数*/
    
    [_priority release];/**<优先权*/
    [_latest release];/**<最新的*/
    [super dealloc];
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"author"]) {
        self.authorId = value[@"authorId"];
        self.authorName = value[@"name"];
        self.authorAvatar = value[@"avatar"];
        self.authorImage = value[@"image"];
        self.authorIntroduction = value[@"introduction"];
        self.authorContactType = value[@"contactType"];
        self.authorContactId = value[@"contactId"];
        self.authorGender = value[@"gender"];
        self.authorContract = value[@"contract"];
        self.authorServiceType = value[@"serviceType"];
        self.authorServiceParam = value[@"serviceParam"];
    }
    if ([key isEqualToString:@"featuredAuthor"]) {
        self.featuredAuthorPriority = value[@"priority"];
    }
    if ([key isEqualToString:@"category"]) {
        if ([value isKindOfClass:[NSArray class]]) {
            for (NSDictionary *temp in value) {
                self.categoryId = temp[@"categoryId"];
                self.categoryName = temp[@"name"];
                self.categoryEnglishName = temp[@"englishName"];
                self.categoryIcon = temp[@"icon"];
                self.categoryImage = temp[@"image"];
                self.categoryPriority = temp[@"priority"];
                self.categoryGroupId = temp[@"categoryGroup"][@"categoryGroupId"];
                self.categoryGroupName = temp[@"categoryGroup"][@"name"];
                self.categoryGroupEnglishName = temp[@"categoryGroup"][@"englishName"];
                self.categoryGroupIcon = temp[@"categoryGroup"][@"icon"];
                self.categoryGroupLargeIcon = temp[@"categoryGroup"][@"largeIcon"];
                self.categoryGroupColor = temp[@"categoryGroup"][@"color"];
                self.categoryGroupImage = temp[@"categoryGroup"][@"image"];
            }
        }
        if ([value isKindOfClass:[NSDictionary class]]) {
            self.categoryId = value[@"categoryId"];
            self.categoryName = value[@"name"];
            self.categoryEnglishName = value[@"englishName"];
            self.categoryIcon = value[@"icon"];
            self.categoryImage = value[@"image"];
            self.categoryPriority = value[@"priority"];
            self.categoryGroupId = value[@"categoryGroup"][@"categoryGroupId"];
            self.categoryGroupName = value[@"categoryGroup"][@"name"];
            self.categoryGroupEnglishName = value[@"categoryGroup"][@"englishName"];
            self.categoryGroupIcon = value[@"categoryGroup"][@"icon"];
            self.categoryGroupLargeIcon = value[@"categoryGroup"][@"largeIcon"];
            self.categoryGroupColor = value[@"categoryGroup"][@"color"];
            self.categoryGroupImage = value[@"categoryGroup"][@"image"];
        }
    }
    if ([key isEqualToString:@"article"]) {
        for (NSDictionary *temp in value[@"image"]) {
            self.articleImageType = temp[@"type"];
            self.articleImageUrl = temp[@"url"];
        }
        self.articleId = value[@"article"][@"articleId"];
        self.articleTitle = value[@"article"][@"title"];
        self.articleSummary = value[@"article"][@"summary"];
        self.articleThumbnail = value[@"article"][@"thumbnail"];
        self.articleUrl = value[@"article"][@"url"];
        self.articleWeblink = value[@"article"][@"weblink"];
        self.articlePublishTime = value[@"article"][@"publishTime"];
        self.articleCreatedTime = value[@"article"][@"createdTime"];
        self.articleCreatedTime = value[@"article"][@"modifiedTime"];
        self.articleStatsRead = value[@"article"][@"articleStats"][@"read"];
        self.articleStatsLike = value[@"article"][@"articleStats"][@"like"];
        self.articleStatsDislike = value[@"article"][@"articleStats"][@"dislike"];
        self.articleStatsComment = value[@"article"][@"articleStats"][@"comment"];
        self.articleStatsFavorite = value[@"article"][@"articleStats"][@"favorite"];
        self.articleStatsShare = value[@"article"][@"articleStats"][@"share"];
        self.articleCategoryId = value[@"category"][@"categoryId"];
        self.articleCategoryName = value[@"category"][@"name"];
        self.articleCategoryEnglishName = value[@"category"][@"englishName"];
        self.articleCategoryIcon = value[@"category"][@"icon"];
        self.articleCategoryImage = value[@"category"][@"image"];
        self.articleCategoryPriority = value[@"category"][@"priority"];
        self.articleCategoryGroupId = value[@"category"][@"categoryGroup"][@"categoryGroupId"];
        self.articleCategoryGroupName = value[@"category"][@"categoryGroup"][@"name"];
        self.articleCategoryGroupEnglishName = value[@"category"][@"categoryGroup"][@"englishName"];
        self.articleCategoryGroupIcon = value[@"category"][@"categoryGroup"][@"icon"];
        self.articleCategoryGroupLargeIcon = value[@"category"][@"categoryGroup"][@"largeIcon"];
        self.articleCategoryGroupColor = value[@"category"][@"categoryGroup"][@"color"];
        self.articleCategoryGroupImage = value[@"category"][@"categoryGroup"][@"image"];
    }
}


@end
